package com.hzcx.app.simplechat.ui.chat.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hzcx.app.simplechat.R;
import com.hzcx.app.simplechat.ui.chat.bean.GroupSearchBean;
import com.hzcx.app.simplechat.util.empty.EmptyUtils;
import com.hzcx.app.simplechat.util.glide.GlideUtils;

import java.util.List;

public class GroupSearchAdapter extends BaseQuickAdapter<GroupSearchBean, BaseViewHolder> {
    public GroupSearchAdapter(@Nullable List<GroupSearchBean> data) {
        super(R.layout.rv_item_friend_content, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GroupSearchBean item) {
        helper.setText(R.id.tv_nick_name, EmptyUtils.isNotEmpty(item.getGroup_name()) ? item.getGroup_name() : item.getGroup_id());
        GlideUtils.loadImg(mContext, item.getGroup_image(), helper.getView(R.id.iv_head));
        helper.setVisible(R.id.tv_online_state, false);
    }
}
